﻿using System;
using BridgeUI.Binding;

///*************************************************************************************
///* 作    者：       zouhunter
///* 创建时间：       2021-04-04 01:40:12
///* 说    明：       1.此代码由工具生成
///                   2.不支持编写的代码
///                   3.请使用继承方式使用
///* ************************************************************************************/

namespace View
{
	/*绑定协议
	 * 001 : options
	 * 002 : ButtonListSelectId
	 */
	public class ListPanelInternal:BridgeUI.Binding.BindingViewBase
	{
		public const byte keyword_options = 001;
		public const byte keyword_ButtonListSelectId = 002;

		/// <summary>
		/// 代码绑定
		/// </summary>
		protected override void OnBinding(UnityEngine.GameObject target)
		{
			base.OnBinding(target);
			var binding = target.GetComponent<ListPanelReference>();
			if (binding != null)
			{
				Binder.RegistValueChange<System.String[]>(x => binding.ButtonList.options = x, keyword_options);
				Binder.RegistEvent(binding.ButtonList.onSelectID, keyword_ButtonListSelectId);
				RegistUIControl(binding.ButtonList);
			}
		}

		/// <summary>
		/// 显示模型模板
		/// <summary>
		public class LogicBase : BridgeUI.Binding.ViewModel
		{
			#region BindablePropertys
			protected BindableProperty<System.String[]> m_options;
			protected BindableProperty<BridgeUI.Binding.PanelAction<System.Int32>> m_ButtonListSelectId;
			#endregion BindablePropertys

			#region Propertys
			public System.String[] options
			{
				get
				{
					if(m_options == null)
					{
						m_options = GetBindableProperty<System.String[]>(keyword_options);
					}
					return m_options;
				}
				set
				{
					if(m_options == null)
					{
						m_options = GetBindableProperty<System.String[]>(keyword_options);
					}
					m_options.Value = value;
				}
			}
			public BridgeUI.Binding.PanelAction<System.Int32> ButtonListSelectId
			{
				get
				{
					if(m_ButtonListSelectId == null)
					{
						m_ButtonListSelectId = GetBindableProperty<BridgeUI.Binding.PanelAction<System.Int32>>(keyword_ButtonListSelectId);
					}
					return m_ButtonListSelectId;
				}
				set
				{
					if(m_ButtonListSelectId == null)
					{
						m_ButtonListSelectId = GetBindableProperty<BridgeUI.Binding.PanelAction<System.Int32>>(keyword_ButtonListSelectId);
					}
					m_ButtonListSelectId.Value = value;
				}
			}
			#endregion Propertys
		}
	}
}
